package pers.brozen.anka.support.wechat;

import lombok.Getter;

/**
 * @author Brozen
 * @date 2019/8/5 3:25 PM
 */
@Getter
public class WeChatException extends RuntimeException {

    private String weChatErrorCode;

    private String weChatErrorMsg;

    public WeChatException(String weChatErrorCode, String weChatErrorMsg) {
        super(weChatErrorMsg);
        this.weChatErrorCode = weChatErrorCode;
        this.weChatErrorMsg = weChatErrorMsg;
    }

    public WeChatException(String weChatErrorCode, String weChatErrorMsg, Throwable cause) {
        super(weChatErrorMsg, cause);
        this.weChatErrorCode = weChatErrorCode;
        this.weChatErrorMsg = weChatErrorMsg;
    }

    public String getWeChatErrorInfo() {
        return String.format("Code: %s  Message: %s", weChatErrorCode, weChatErrorMsg);
    }

}
